home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / devel / prolog / diffs / diff_1_8.10 < prev    next >
Encoding:
Text File  |  1994-03-22  |  16.1 KB  |  562 lines

  1. diff -c -r +new-file pl/STAMP pl/STAMP
  2. *** pl/STAMP    Wed Mar  2 18:10:32 1994
  3. --- pl/STAMP    Tue Mar 22 12:05:08 1994
  4. ***************
  5. *** 1 ****
  6. ! Wed Mar 2 18:08:00 MET 1994
  7. --- 1 ----
  8. ! Tue Mar 22 12:03:06 MET 1994
  9. diff -c -r +new-file pl/VERSION pl/VERSION
  10. *** pl/VERSION    Wed Mar  2 15:32:01 1994
  11. --- pl/VERSION    Mon Mar 21 17:45:45 1994
  12. ***************
  13. *** 1 ****
  14. ! 1.8.9
  15. --- 1 ----
  16. ! 1.8.10
  17. diff -c -r +new-file pl/library/quintus.pl pl/library/quintus.pl
  18. *** pl/library/quintus.pl    Wed Mar  2 15:32:30 1994
  19. --- pl/library/quintus.pl    Mon Mar 21 17:46:13 1994
  20. ***************
  21. *** 1,4 ****
  22. ! /*  quintus.pl,v 1.7 1994/03/02 14:32:30 jan Exp
  23.   
  24.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  25.       jan@swi.psy.uva.nl
  26. --- 1,4 ----
  27. ! /*  quintus.pl,v 1.8 1994/03/21 16:46:13 jan Exp
  28.   
  29.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  30.       jan@swi.psy.uva.nl
  31. ***************
  32. *** 28,34 ****
  33. --- 28,36 ----
  34.       , otherwise/0
  35.       , (initialization)/1
  36.       , absolute_file_name/3
  37. +     , prolog_load_context/2
  38.       , numbervars/3
  39. +     , statistics/2
  40.       ]).
  41.   
  42.           /********************************
  43. ***************
  44. *** 79,84 ****
  45. --- 81,108 ----
  46.       concat(Base, Ext, Name).
  47.   
  48.   
  49. + %    prolog_load_context(+Key, -Value)
  50. + %
  51. + %    Provides context information for term_expansion and directives.
  52. + %    Note that only the line-number info is valid for the
  53. + %    '$stream_position'
  54. + :- module_transparent
  55. +     prolog_load_context/2.
  56. + prolog_load_context(module, M) :-
  57. +     context_module(M).
  58. + prolog_load_context(file, F) :-
  59. +     source_location(F, _).
  60. + prolog_load_context(stream, S) :-
  61. +     current_input(S).
  62. + prolog_load_context(directory, D) :-
  63. +     source_location(F, _),
  64. +     '$file_dir_name'(F, D).
  65. + prolog_load_context(term_position, '$stream_position'(0,L,0,0,0)) :-
  66. +     source_location(_, L).
  67.           /********************************
  68.           *        META PREDICATES        *
  69.           *********************************/
  70. ***************
  71. *** 141,146 ****
  72. --- 165,198 ----
  73.   
  74.   random(Min, Max, Value) :-
  75.       Value is Min + random(Max).
  76. +          /*******************************
  77. +          *        STATISTICS        *
  78. +          *******************************/
  79. + :- recorda('$runtime', 0, _).
  80. + statistics(runtime, [Total, New]) :- !,
  81. +     system:statistics(cputime, Time),
  82. +     Total is integer(Time * 1000),
  83. +     recorded('$runtime', Old, Ref),
  84. +     New is Total - Old,
  85. +     erase(Ref),
  86. +     recorda('$runtime', Total, _).
  87. + statistics(program, [InUse, _Free]) :- !,
  88. +     system:statistics(heapused, InUse).
  89. + statistics(heap, Stat) :- !,
  90. +     statistics(program, Stat).
  91. + statistics(global_stack, [InUse, Free]) :- !,
  92. +     system:statistics(globalused, InUse),
  93. +     system:statistics(globallimit, Limit),
  94. +     Free is Limit - InUse.
  95. + statistics(local_stack, [InUse, Free]) :- !,
  96. +     system:statistics(localused, InUse),
  97. +     system:statistics(locallimit, Limit),
  98. +     Free is Limit - InUse.
  99. + statistics(trail, [InUse]) :- !,
  100. +     system:statistics(trailused, InUse).
  101.   
  102.   
  103.           /********************************
  104. diff -c -r +new-file pl/src/md-hp.h pl/src/md-hp.h
  105. *** pl/src/md-hp.h    Mon Dec  6 18:00:51 1993
  106. --- pl/src/md-hp.h    Mon Mar 21 17:46:38 1994
  107. ***************
  108. *** 1,4 ****
  109. ! /*  md-hp.h,v 1.18 1993/12/06 17:00:51 jan Exp
  110.   
  111.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  112.       See ../LICENCE to find out about your rights.
  113. --- 1,4 ----
  114. ! /*  md-hp.h,v 1.19 1994/03/21 16:46:38 jan Exp
  115.   
  116.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  117.       See ../LICENCE to find out about your rights.
  118. ***************
  119. *** 43,48 ****
  120. --- 43,51 ----
  121.       library function vsprintf().
  122.       He successfully compiled on a hp9000s700 running hpux 8.07.
  123.       The resulting binary runs on both machines.
  124. + Version 1.8.10 includes some patches by  Dave   Sherratt  for  the HP cc
  125. + compiler.
  126.   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  127.   
  128.   #define MACHINE            "hp"
  129. ***************
  130. *** 61,67 ****
  131.   #define M_CFLAGS        
  132.   #else                    /* Use HP-UX cc */
  133.   #define M_CC            cc
  134. ! #define M_OPTIMIZE        +O1 +Obb650 /* In HP-UX 8.07, can use +O3 */
  135.   #define M_LDFLAGS        -O -Wl,-a archive
  136.   #define M_CFLAGS        -Aa -D_HPUX_SOURCE -Dunix -Dhpux -I/usr/local/include -I/usr/local/include/readline
  137.   #endif
  138. --- 64,70 ----
  139.   #define M_CFLAGS        
  140.   #else                    /* Use HP-UX cc */
  141.   #define M_CC            cc
  142. ! #define M_OPTIMIZE        +O1 +Obb700 /* In HP-UX 8.07, can use +O3 */
  143.   #define M_LDFLAGS        -O -Wl,-a archive
  144.   #define M_CFLAGS        -Aa -D_HPUX_SOURCE -Dunix -Dhpux -I/usr/local/include -I/usr/local/include/readline
  145.   #endif
  146. diff -c -r +new-file pl/src/md-linux.h pl/src/md-linux.h
  147. *** pl/src/md-linux.h    Wed Mar  2 15:32:50 1994
  148. --- pl/src/md-linux.h    Mon Mar 21 17:46:40 1994
  149. ***************
  150. *** 1,4 ****
  151. ! /*  md-linux.h,v 1.19 1994/03/02 14:32:50 jan Exp
  152.   
  153.       Copyright (c) 1992 Jan Wielemaker/Pieter Olivier. All rights reserved.
  154.       See ../LICENCE to find out about your rights.
  155. --- 1,4 ----
  156. ! /*  md-linux.h,v 1.20 1994/03/21 16:46:40 jan Exp
  157.   
  158.       Copyright (c) 1992 Jan Wielemaker/Pieter Olivier. All rights reserved.
  159.       See ../LICENCE to find out about your rights.
  160. ***************
  161. *** 33,38 ****
  162. --- 33,46 ----
  163.       results in multiple symbol declaration when SWI-Prolog is linked.
  164.       As a temporary fix remove /usr/lib/libtermcap.sa while linking
  165.       SWI-Prolog.
  166. + Thu Mar 10 22:14:20 1994
  167. +     Updated version 1.8.9. The stdio file structure elements were
  168. +     changed with libc 4.5.8 and above. The linux stdio now uses the
  169. +     libio structures. The old (and new) versions still don't work
  170. +     the way RESET_STDIN is meant to work. There seems to be no portable
  171. +     way to handle flushing all to-be-input characters when doing a save/1.
  172. +     Kayvan Sylvan (kayvan@Sylvan.COM) also (kayvan@Quintus.COM).
  173.   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  174.   
  175.   #define M_CC            gcc
  176. ***************
  177. *** 39,45 ****
  178.   #define M_OPTIMIZE            -O2
  179.   /*#define M_OPTIMIZE        -g*/
  180.   #define M_LDFLAGS        -static
  181. ! #define M_CFLAGS        -ansi -pedantic -Wall -funsigned-char
  182.   #define M_LIBS            -lm -ltermcap -lreadline
  183.   
  184.               /* compiler */
  185. --- 47,54 ----
  186.   #define M_OPTIMIZE            -O2
  187.   /*#define M_OPTIMIZE        -g*/
  188.   #define M_LDFLAGS        -static
  189. ! /*#define M_CFLAGS        -ansi -pedantic -Wall -funsigned-char*/
  190. ! #define M_CFLAGS        -Wall -funsigned-char
  191.   #define M_LIBS            -lm -ltermcap -lreadline
  192.   
  193.               /* compiler */
  194. ***************
  195. *** 73,78 ****
  196. --- 82,93 ----
  197.   #define DIR_INCLUDE2        <dirent.h>
  198.   #define TERMIO_INCLUDE        <termio.h>
  199.   #define O_GETCWD        1
  200. + /* This is for the newer libc (4.5.8+) */
  201. + #ifdef _STDIO_USES_IOSTREAM
  202. + #define _gptr _IO_read_ptr
  203. + #define _egptr _IO_read_end
  204. + #endif
  205.   
  206.   #include <linux/limits.h>
  207.   
  208. diff -c -r +new-file pl/src/md-sgi.h pl/src/md-sgi.h
  209. *** pl/src/md-sgi.h    Wed Mar  2 15:32:52 1994
  210. --- pl/src/md-sgi.h    Mon Mar 21 17:46:41 1994
  211. ***************
  212. *** 1,4 ****
  213. ! /*  md-sgi.h,v 1.6 1994/03/02 14:32:52 jan Exp
  214.   
  215.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  216.       See ../LICENCE to find out about your rights.
  217. --- 1,4 ----
  218. ! /*  md-sgi.h,v 1.7 1994/03/21 16:46:41 jan Exp
  219.   
  220.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  221.       See ../LICENCE to find out about your rights.
  222. ***************
  223. *** 13,24 ****
  224.   It appears `O_FOREIGN 1' gives problems on some SGI archiectures. It you
  225.   are not a C-hacker change this into O_FOREIGN 0. Otherwise you might
  226.   want to start debugging.
  227.   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  228.   
  229.   #define M_CC            gcc
  230.   #define M_OPTIMIZE        -O2
  231.   #define M_LDFLAGS        
  232. ! #define M_CFLAGS
  233.   #define M_LIBS            -lm -ltermcap
  234.   
  235.   
  236. --- 13,26 ----
  237.   It appears `O_FOREIGN 1' gives problems on some SGI archiectures. It you
  238.   are not a C-hacker change this into O_FOREIGN 0. Otherwise you might
  239.   want to start debugging.
  240. + Added -DANSI -D_BSD_SIGNALS after report from Fergus Henderson
  241.   - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  242.   
  243.   #define M_CC            gcc
  244.   #define M_OPTIMIZE        -O2
  245.   #define M_LDFLAGS        
  246. ! #define M_CFLAGS        -DANSI -D_BSD_SIGNALS
  247.   #define M_LIBS            -lm -ltermcap
  248.   
  249.   
  250. diff -c -r +new-file pl/src/pl-alloc.c pl/src/pl-alloc.c
  251. *** pl/src/pl-alloc.c    Wed Mar  2 15:32:54 1994
  252. --- pl/src/pl-alloc.c    Mon Mar 21 17:46:42 1994
  253. ***************
  254. *** 1,4 ****
  255. ! /*  pl-alloc.c,v 1.12 1994/03/02 14:32:54 jan Exp
  256.   
  257.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  258.       See ../LICENCE to find out about your rights.
  259. --- 1,4 ----
  260. ! /*  pl-alloc.c,v 1.13 1994/03/21 16:46:42 jan Exp
  261.   
  262.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  263.       See ../LICENCE to find out about your rights.
  264. ***************
  265. *** 93,99 ****
  266.   
  267.     n = ALLOCROUND(n);
  268.     statistics.heap -= n;
  269. !   DEBUG(9, printf("freed %ld bytes at %ld\n", n, (unsigned long)p));
  270.   
  271.     if (n <= ALLOCFAST)
  272.     { n /= sizeof(align_type);
  273. --- 93,100 ----
  274.   
  275.     n = ALLOCROUND(n);
  276.     statistics.heap -= n;
  277. !   DEBUG(9, printf("freed %ld bytes at %ld\n",
  278. !           (unsigned long)n, (unsigned long)p));
  279.   
  280.     if (n <= ALLOCFAST)
  281.     { n /= sizeof(align_type);
  282. diff -c -r +new-file pl/src/pl-file.c pl/src/pl-file.c
  283. *** pl/src/pl-file.c    Wed Mar  2 15:33:04 1994
  284. --- pl/src/pl-file.c    Mon Mar 21 17:46:43 1994
  285. ***************
  286. *** 1,4 ****
  287. ! /*  pl-file.c,v 1.20 1994/03/02 14:33:04 jan Exp
  288.   
  289.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  290.       See ../LICENCE to find out about your rights.
  291. --- 1,4 ----
  292. ! /*  pl-file.c,v 1.21 1994/03/21 16:46:43 jan Exp
  293.   
  294.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  295.       See ../LICENCE to find out about your rights.
  296. ***************
  297. *** 760,766 ****
  298. --- 760,770 ----
  299.     struct timeval t, *to;
  300.     real time;
  301.     int n, max = 0;
  302. + #if hpux
  303. +   extern int select(size_t, int *, int *, int *, const struct timeval *);
  304. + #else
  305.     extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
  306. + #endif
  307.   
  308.     FD_ZERO(&fds);
  309.     while( isList(*streams) )
  310. diff -c -r +new-file pl/src/pl-itf.h pl/src/pl-itf.h
  311. *** pl/src/pl-itf.h    Wed Mar  2 15:33:12 1994
  312. --- pl/src/pl-itf.h    Mon Mar 21 17:46:44 1994
  313. ***************
  314. *** 1,4 ****
  315. ! /*  pl-itf.h,v 1.40 1994/03/02 14:33:12 jan Exp
  316.   
  317.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  318.       See ../LICENCE to find out about your rights.
  319. --- 1,4 ----
  320. ! /*  pl-itf.h,v 1.41 1994/03/21 16:46:44 jan Exp
  321.   
  322.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  323.       See ../LICENCE to find out about your rights.
  324. ***************
  325. *** 11,17 ****
  326.   #define PL_INCLUDED
  327.   
  328.   #ifndef PLVERSION
  329. ! #define PLVERSION "1.8.9 March 1994"
  330.   #endif
  331.   
  332.   #if __GNUC__ && !__STRICT_ANSI__
  333. --- 11,17 ----
  334.   #define PL_INCLUDED
  335.   
  336.   #ifndef PLVERSION
  337. ! #define PLVERSION "1.8.10 March 1994"
  338.   #endif
  339.   
  340.   #if __GNUC__ && !__STRICT_ANSI__
  341. diff -c -r +new-file pl/src/pl-os.c pl/src/pl-os.c
  342. *** pl/src/pl-os.c    Wed Mar  2 17:50:44 1994
  343. --- pl/src/pl-os.c    Mon Mar 21 17:49:36 1994
  344. ***************
  345. *** 1,4 ****
  346. ! /*  pl-os.c,v 1.42 1994/03/02 16:50:44 jan Exp
  347.   
  348.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  349.       See ../LICENCE to find out about your rights.
  350. --- 1,4 ----
  351. ! /*  pl-os.c,v 1.44 1994/03/21 16:49:36 jan Exp
  352.   
  353.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  354.       See ../LICENCE to find out about your rights.
  355. ***************
  356. *** 16,21 ****
  357. --- 16,24 ----
  358.   #if OS2 && EMX
  359.   #include <os2.h>                /* this has to appear before pl-incl.h */
  360.   #endif
  361. + #ifdef linux
  362. + #include <stdio.h>
  363. + #endif
  364.   #include "pl-incl.h"
  365.   #include "pl-ctype.h"
  366.   #include "pl-itf.h"
  367. ***************
  368. *** 1385,1391 ****
  369.     }
  370.     
  371.     strcpy(path, CWDdir);
  372. !   strcpy(&path[CWDlen], file);
  373.     if ( strchr(file, '.') || strchr(file, '/') )
  374.       return canonisePath(path);
  375.     else
  376. --- 1388,1395 ----
  377.     }
  378.     
  379.     strcpy(path, CWDdir);
  380. !   if ( file[0] != EOS )
  381. !     strcpy(&path[CWDlen], file);
  382.     if ( strchr(file, '.') || strchr(file, '/') )
  383.       return canonisePath(path);
  384.     else
  385. ***************
  386. *** 1617,1622 ****
  387. --- 1621,1643 ----
  388.   
  389.   #define savestring(x) strcpy(xmalloc(1 + strlen(x)), (x))
  390.   
  391. + static Char
  392. + GetRawChar(void)
  393. + { unsigned char chr;
  394. +   if ( PL_dispatch_events )
  395. +   { while((*PL_dispatch_events)() != PL_DISPATCH_INPUT)
  396. +       ;
  397. +   }
  398. +   if (read(0, &chr, 1) == 0)
  399. +     return EOF;
  400. +   else
  401. +     return chr;
  402. + }
  403.   Char
  404.   GetChar(void)
  405.   { static char *line;            /* read line */
  406. ***************
  407. *** 1626,1648 ****
  408.     Char c;
  409.   
  410.     if ( ttymode == TTY_RAW )
  411. !   { if ( PL_dispatch_events )
  412. !     { for(;;)
  413. !       { if ( (*PL_dispatch_events)() == PL_DISPATCH_INPUT )
  414. !     { char chr;
  415. !       if (read(0, &chr, 1) == 0)
  416. !         c = EOF;
  417. !       else
  418. !         c = (Char) chr;
  419. !       break;
  420. !     }
  421. !       }
  422. !     } else
  423. !     { char chr;                /* don't use getchar(); I/O buffer */
  424. !                     /* might not be empty after save() */
  425. !       c = (read(0, &chr, 1) == 0 ? EOF : chr);
  426.       }
  427.     } else
  428.     { if ( !line )
  429.       { ttybuf buf;
  430. --- 1647,1667 ----
  431.     Char c;
  432.   
  433.     if ( ttymode == TTY_RAW )
  434. !   { c = GetRawChar();
  435. !   } else if ( status.notty )
  436. !   { if ( !line )
  437. !     { extern int Output;
  438. !       int old = Output;
  439. !       Output = 1;
  440. !       Putf("%s", PrologPrompt());
  441. !       pl_flush();
  442. !       Output = old;
  443. !       line = "ok";
  444.       }
  445. +     if ( (c=GetRawChar()) == '\n' )
  446. +       line = NULL;
  447.     } else
  448.     { if ( !line )
  449.       { ttybuf buf;
  450. ***************
  451. *** 1682,1687 ****
  452. --- 1701,1707 ----
  453.   
  454.     source_line_no   = sln;
  455.     source_file_name = sfn;
  456.     return c;
  457.   }
  458.   
  459. diff -c -r +new-file pl/src/pl-read.c pl/src/pl-read.c
  460. *** pl/src/pl-read.c    Wed Mar  2 15:33:23 1994
  461. --- pl/src/pl-read.c    Mon Mar 21 17:46:46 1994
  462. ***************
  463. *** 1,4 ****
  464. ! /*  pl-read.c,v 1.15 1994/03/02 14:33:23 jan Exp
  465.   
  466.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  467.       See ../LICENCE to find out about your rights.
  468. --- 1,4 ----
  469. ! /*  pl-read.c,v 1.16 1994/03/21 16:46:46 jan Exp
  470.   
  471.       Copyright (c) 1990 Jan Wielemaker. All rights reserved.
  472.       See ../LICENCE to find out about your rights.
  473. ***************
  474. *** 97,103 ****
  475.     char *here;            /* current position in read buffer */
  476.     int   stream;            /* stream we are reading from */
  477.     FILE *fd;            /* file descriptor we are reading from */
  478. -   bool    doExtend;        /* extension mode on? */
  479.   } rb;
  480.   
  481.   #if O_PCE
  482. --- 97,102 ----
  483. ***************
  484. *** 125,131 ****
  485.     rb_stack[read_nesting++] = rb;
  486.     rb = rb_stack[read_nesting];
  487.   #endif /* O_PCE */
  488. -   rb.doExtend = (Input == 0 && status.notty == FALSE);
  489.     rb.stream = Input;
  490.     rb.fd = checkInput(rb.stream);
  491.     source_file_name = currentStreamName();
  492. --- 124,129 ----
  493. diff -c -r +new-file pl/src/sun-types.h pl/src/sun-types.h
  494. *** pl/src/sun-types.h
  495. --- pl/src/sun-types.h    Mon Mar 21 17:46:47 1994
  496. ***************
  497. *** 0 ****
  498. --- 1,43 ----
  499. + /*  sun-types.h,v 1.1 1994/03/21 16:46:47 jan Exp
  500. +     Part of XPCE
  501. +     Designed and implemented by Anjo Anjewierden and Jan Wielemaker
  502. +     E-mail: jan@swi.psy.uva.nl
  503. +     Copyright (C) 1994 University of Amsterdam. All rights reserved.
  504. + */
  505. + /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  506. + Missing sun type declarations to allow gcc -Wall
  507. + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  508. + extern int sscanf (const char *, const char *, ...);
  509. + extern int fscanf (FILE *, const char *, ...);
  510. + extern int printf (const char *, ...);
  511. + extern int _filbuf (FILE *);
  512. + extern int _flsbuf (unsigned int, FILE *);
  513. + extern long time (long *);
  514. + extern int gethostname(char *name, int namelen);
  515. + extern int fprintf (FILE *, const char *, ...);
  516. + extern int fflush (FILE *);
  517. + extern long int strtol (const char *, char **, int);
  518. + extern int vprintf (const char *, char * );
  519. + extern int vsprintf (char *, const char *, char * );
  520. + extern int vfprintf (FILE *, const char *, char * );
  521. + extern long unsigned int fread (void *, long unsigned int,
  522. +                 long unsigned int, FILE *);
  523. + extern long unsigned int fwrite (const void *, long unsigned int,
  524. +                  long unsigned int, FILE *);
  525. + extern int ungetc (int, FILE *);
  526. + extern int getw(FILE *stream);
  527. + extern int putw(int data, FILE *stream);
  528. + extern int pclose(FILE *stream);
  529. + extern int fclose(FILE *stream);
  530. + extern void bcopy(void *b1, void *b2, int length);
  531. + extern int fseek (FILE *, long int, int);
  532. + extern char *getwd(char *pathname);
  533. + extern int ioctl(int fd, int request, void *arg);
  534. + extern void bzero(void *b, int length);
  535. + extern int brk(void *addr);
  536. + extern void *sbrk(int incr);
  537. + extern int system (const char *);
  538.